package com.liuzu.esys.listener;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.liuzu.esys.bo.RefundAfterSaleBo;
import com.liuzu.esys.pojo.RefundAfterSale;
import com.liuzu.esys.service.RefundAfterSaleService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;

public class WebRefundAfterSaleListener extends AnalysisEventListener<RefundAfterSaleBo> {
    @Autowired
    RefundAfterSaleService refundAfterSaleService;


    @Override
    public void invoke(RefundAfterSaleBo data, AnalysisContext analysisContext) {
        System.out.println(data);
        RefundAfterSale refundAfterSale = new RefundAfterSale();

        BeanUtils.copyProperties(data, refundAfterSale);
        refundAfterSaleService.refundAfterSaleAdd(refundAfterSale);
    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {

    }
}